from datetime import datetime

now = datetime.now()
print("ct的类型", type(now), "ct的值", now)
dt1 = datetime(2008, 8, 1, 6, 30, 15)
print("dt1的类型", type(dt1), "dt1的值", dt1)
# dt1格式化
dtf1 = dt1.strftime("%Y年%m月%d日 %H时%M分%S秒")
print("dtf1的类型", type(dtf1), "dtf1的值", dtf1)
dt_start = datetime(2008, 1, 12)
dt_end = datetime(2009, 1, 1)
print(dt_start < dt_end)  # True

str1 = "2024-8-1"
dt_result = datetime.strptime(str1, "%Y-%m-%d")

print("dt_result的类型", type(dt_result), "dt_result的值", dt_result)
